Small improvements and cleanup