bunch of bug fixes; added rake task for number db generation