Fix bug and header problem