fix a Sinatra level bug and add test for it

so-ri- for mai ingurissyu.