Added enhanced ruby mode, some fixes