Fix get and count methods, support ranges and directions