Closes #167, #168 and #112

nt