Clean up some warnings, and make the CRT ones more relevant

Bonus: Fix a memory leak