Use return instead of returnM, and similar tidy-ups