Fixed API bugs

Variables not statically referenced