check for zero sizes. Fixes #177