bug fixes from working on SBC