Small improvements and minor cleanup