Add deserializeAlign and various helper functions