Fixing some pointers issues