bug fixes, and less bitstarter specific code