Fixing linking issues and call time pass by reference error