Fix for issue #1370 and issue #1371

This rolls back part of the change that fixed #1369 it should resolve issue #1370 and issue #1371.