Thanks a lot! I forgot the existence of the sampling statement as in first iteration I needed all the constants as well.
About the last part, that is due to the deep-copy issue (Deep copy warning), using tmp only copies of the single columns are needed instead of copying whole matrix, I think.