Small code optimizations

Added statics + check > 0 from pull #10, and small optimization in
FinalizeLogin.