Fixed implicit cast bug (issue #2).