Fixed emptying bug