Implemented suggestions by WouterJ.