Minor improvements and cleanup