Fix issue #138, #137, #136?, #135, #133.