Added fprintf debug statements