Fix: missing global declarations

Also removed unused ones