Fix creation of tmpdir to after keys are pushed