#672 and #671 fixed