File merge error fixes + petty changes

from the last commit there were errors syncing the commits, this fixes
the reference issues along with other minor alterations.