bracket mismatch and missing include bugfixes