Fix type erasure causing failure in production