Fixed errors and warning