Moved 'long' type existence determination outside of function to increase speed.