Fix INTERVAL handling ; add a test for it