Added fragment and minor fixes