Fixed errors, allowing rake task to run