#118 and minor fixes