Cleanup of code and small changes
Merged