MySQL migration part 1: minor fixes