Minor code imporvements