Misc. bugfixes for parsing sections and program headers.