Fixes #1197. Fixes #1185. Fixes #1183. Fixes #1178. Fixes #1173. Fixes #1175. Fixes #1164. Fixes #1156.