Fix to solve #157 and #158