fix #440, #439, #438