Minor code fix and changes