output prefixes and fix some crashes