Initial cleanup & reference fixes