Changes for feature request + bug fixes