Fixed errors with code