Fixed a crash

This error has created like hundreds of crashes on the crash archive. Example:
http://crash.pocketmine.net/view/18517
Fixed wrong things
Merge pull request #1 from PEMapModder/master

Fixed a crash