Fixed select bug, fixed merged, added HAVING, added support for ISO13606-5, added type-checking