Fixes issue #15, now throws correct error message in case of missing div