1.0.4 improvements by mknadler and bug fix