Improve performance
Change sign checking for Durations.

Thanks to @egilburg comment in https://github.com/rails/rails/pull/16917 pull
request for catching this.
Fix atomizing durations with ,

Thanks to @Envek for catching it in https://github.com/rails/rails/pull/16917