Some modifications/additions/pathces