INSERT query fixes