Minor improvements suggested by @WouterJ