Wip/warnings

Not-yet-merged patches from issue #633.