Fixs from 'merge #405 and #406'