type-cast id(n) into int values in where clauses

closes #27