Fixed trailing quote bug corner cases