Allow key size definition, fix messages, add checks