Fixed bug on decimal return and the corresponding test