Added message length/definition check