Fixed mayor crashing bugs