Removed casting

..because I didn't read the javadoc carefully!