Check for error or missing result from getBinCount

Fixes @electricg's issue