Fixed some bugs. Working on key rotation methods