Run rake test and fix errors