correct GridFS behaviour and other small fixes