Fix some issues reported by @andresmoschini.