Fixed possible filling bugs