Issue #1: Some bug fixes.