Fixed errors, removed unnecessary logging