Quake sways buildings; some evacuations