More little cleanups + bug fixes