Minor bug fixes / additional hardening