Fixes to issues omitted while active record migration