Fixed blank insert errors and added tests for them