Closed #540 and closed #554