improved BAP parsing + fixes