fix to ERRAI-536
cleanup
merge
merge in fixes for ERRAI-536