Fixed crash on migrations