Added some casts (Issue #25).