Fixed an interesting bug

1. `flag | O_CREAT' or `flags & O_CREAT'
2. Other small updates