Fixed a syntax error

I found a syntax error in the **already released** version 2.5.4. The
blocks of `if`/`else` statements that were added on 21 May were missing
`end` expressions, breaking the gem and making any app that imports it
halt. Simply running the tests *before* release rather than just making
quick changes and hoping that the thing still works would have prevented
this from happening. It literally just took 1.866 seconds to run them here.
That two seconds of time is well worth the reward of not looking foolish.