Works with ruby OFF rails, and a bugfix