dp2 casting fix (issue #28)