Made changes suggested by WouterJ