Register IF statement - Take 2

OK, here's another try =)

I split up the IF statement into single IF statements, and thanks to [Davey Shafik](https://twitter.com/dshafik/status/372178743999340544), this time I created a little edit function so that I could return on the first error found, thus (really) not changing the logic like I claimed last time. 

Thanks!