Resolved #170 and #145