Removed some dead codes

Signed-off-by: Rick Minerich <richard.minerich@gmail.com>
slightly changed the way results are cast

Signed-off-by: Rick Minerich <richard.minerich@gmail.com>