Fix bug in position(long) and tune performance tests