some fixes and ast dumper to help with debugging