Fixed wrong parameter check, closes #678