Fixed memory problems
Fixed issue where surfaces weren't freed, resulting in system crashes through lack of memory