Some bug fixes and new cipher