Fix #322

It fixes the issue according to #322 and #324.