Fix errors found by Melissa