fix bugs introduced during last minute cleanup