Fix small code typo & small refactor to avoid superfluous test

Stacktrace for typo: http://dev.1flow.net/webapps/1flow/group/4093/

regards,