Fixing issues #252 and #251.