Minor refactor; source analysis fixes