Fixes various issues reported by blogantinom