Fix to #23, #46