Fixes a few small syntax and other errors
More fixes for migrations