Added message padding, length checks, and errors.