fixed includes (gcc 4.7)
fixed order of undeclared symbols