migrate: Add typeof for undefined check, double -> single quotes

Basically all style fixes.