Bug fix, respect limits and ruby syntax