Added named scope filters, added more cast-methods for different database types