Fix errors, refs #39