s1539 bug fixes and test fixes.