Fixes based on pkh's comments.