Fixes for registration through captcha, little code cleanup