Fixed memory issues - should now be able to free all allocated memory by calling bc_free_coordmap