Improve test coverage; fix a small bug with empty types