Create keys and other bug fixes