fixing some typos and build.gralde problems
use type coercion, if types are present on the Fields instance before writing to sink