Fix empty slice regression

Fixes #446 and adds some additional checks.