Some cleanup and improved checks in prewhiten