Fixed Cast Error. Fixes ticket #14