Fixed minor bugs on INSERT