Added GPL notice, minor cleanups, fprintf(stderr, instead of printf.