Fixed the problems with limit / offset queries in newer CodeIgniter versions.