Fixed errors/warnings due to restructure