Re-fixed SHARK-172, since previous fix causes regressions