Minor changes
Working with keywords only when they're available
Added option to close the database when its end is reached