Various bug fixes

Closes #102 #103 #106 #120 #126