Fix migrations bug