Fixed errors in controllers