Some bug fixes

Yet many remain... :/