Fixed a bug came out when solving issue #49.