change FIXME to TODO, since it is not critical
fixed sql creation bug, and added tests