fixed an AMD bug; fixed a bug with docReady as related to AMD