More work
Adding missing includes for polynomials
Bugfix on upcasting of polynomials