 			else if @is_upper c then caps++
 			else if @is_lower c then lowers++
 
-		if lowers >= caps and lowers >= digits then is_lower
-		else if digits > lowers and digits >= caps then is_digit
-		else is_upper
+		if lowers >= caps and lowers >= digits then @is_lower
+		else if digits > lowers and digits >= caps then @is_digit
+		else @is_upper
 
 	add_syms: (input, n) ->
 		return input if n <= 0

		arr.push input[last...]
		arr.join ""

window.PasswdGenerator = PasswdGenerator

		i = 0
		ret = null
		tmpl = [ "OneShallPass v2.0", @email, passwd.site, passwd.generation ].join ""
		until ret
			# TODO 1SP uses purepack to concatenate strings
			a = tmpl.concat i.toString()
			hash = C.HmacSHA512 a, @_key
			b64 = hash.toString C.enc.Base64
			ret = b64 if @is_ok_pw b64
			i++
		x = @add_syms ret, passwd.num_symbols
		x[0...passwd.length]

	# Rules for 'OK' passwords:
	#    - Within the first 8 characters:
