Got level editor working and fixed some minor bugs