Fixed error where some stuff was being attempted before setup was done.