Avoid casting already immutable values

Should fix #9