Fixed a bug that 'TypeError' occurs. This change helps to close #13.