Fixed minor flaws in operating with data from a dataframe