Added a few missing deletes (might want to double check them though), and fixed some uninitalized variables (might want to check the default values I set)