Added the ability to add a callback when using sync().
Also fixed an issue with the BTL_GET_QUERY use condition.