Minor fixes and captcha function updated