Fixed errors as per Doug's request