Applied fixes to 3.0 -> 3.2 migration code

This fixed the issues I found while debugging track issue: http://trac.zentyal.org/ticket/7693