Various fixes, improvements and cleanup