Issue fixes

#175, #173, #171, #164, #163, #161, #158, #157