Fix crash? And removing warnings