Prevent empty buffers

References #30.