Fix some broken references, missing static-ness and duplicate constant usage