Cleanup & various fixes