fixed #232 and #233.