Added some debugmessages and error handlings
Merge branch 'master' of https://github.com/TorbenHaug/BS.git