Make cursor-related functions more idiomatic (and slightly faster in some cases)