Minor code cleanup in firmware