Various bug fixes that seem to have resolved most issues