Somehow I deleted the call eam_initial(m,te1) line and I was segfaulting because of it.