Some code fixing