Fixed #97 and #76