Minor fixes to issues left while active record migration