Fix bug

Fix bug of encryption (check mac value) when some fields are not used.