Merge pull request #1 from Comedyman937/master

Merge pull request #6 from PEMapModder/patch-1
Fixed a crash

Crash report: http://crash.pocketmine.net/view/22711
It is a bad practice to write code like this, but it is already bad in the first case, so let's let that go :D
Merge pull request #7 from PEMapModder/patch-1

Fixed another crash on unload