Issue #2. Correct getter cast before returning result.
Add tests for non static fields as well. Issue #2