bugfixes for invalid includes and bracket mismatches