Fixes for detecting errors in keys send