Fixed a syntax error and a logic error.

Syntax: used a $ where I shouldn't have.
Logic: was checking behavior type in keyschedule, shouldn't have. Always
encrypt in keyschedule.