Minor code cleanup and parser tweaks