Throw exception when extent is not given. Add test.