Fixed error handling for the shorter keys