Fixed issues #1094 and #2302