fixes #393 and #388

also cleaned erroneous whitespace