Minor bug fixes spotted after pylinting.