small fixes and CodeCleanup