Fix 2nd round of issues reported by @gprasant