Fixes casting discount issues for #105 and #106