Fixed some errors introduced in refactoring

Also cleared cache