minor bugfix and some migration fixes