fix various snap errors, fix #377