Fixes #111, #107, #104, #100