Fixes for key validation