Minor bug fixes in the sql statements for the parent and child
add/inserts...was crashing the program.