closes #3594 and #3597