Fixed a couple of issues reported by a-lurker