Fixes for #528 #473 #377