Fixed Issue #23, enhancement #26, #27