More cleanup

Fixed bugs left over from last cleanup.