migrations bug fixes

Signed-off-by: Marcin Wiatr <marcin@qi-interactive.com>