Raet presence key fix

1. Updated key.py
There was my mistake: mixed PRE and PEND constant names where should be the only PEND
2. Fixed merge mistake in modules/state.py
There were 2 variables initialization removed during merge