Small Fixes and Code Cleaning