Fixing the problem described in #156.

Issues:
fix #156