Fixed various boss-related bugs which caused crashes

Fixes #131, #132, #133
Merge branch 'master' into boss_bugfixes
Fixed broken test