Fixed strange JDK 8 bug with type inference