Bug fixes and tweaks, mainly to occSSxxx functions