Fix for #26 & #28

This pull request fixes issues #26 and #28 as well as some other small bugs. I've also added some of the new features from the forgottenserver repo.