Removed dependencies on GM_ functions