Fixed MessageParser bugs, and corrected tests