changed dst to src to fix record creation
some IR optimizations
fix a bug on records
correct function convetions
fix wrong bound checking on arrays