Renamed msg to proto.
Small fixes and improvements.