Fixed a couple of coding errors.
Added hook for custom login.