Added explicit waits to make the testing more reliable