fix offsetExists()
More qa and refactoring