shared: Prevent segfault in case parameter arg is wrong
shared: Add missing break in message serialization
test: Add serialize message tests for all types

Also add tests for incorrect number of params and correct db
serialization for INT type.