Fixed issue #23 (Empty objects get serialized with incorrect type)