Minor changes to decoder function.