Fix #283, #278, #272