Fix minor issue and improve interface.