Localize some functions for get_current_pos