Fixes #547 and adds test coverage around decimal truncation.