Burntisland developed as a seaport, being second only to Leith in the Firth of Forth, and shipbuilding became an important industry in the town. James V improved the harbour in 1540. During the war of the Rough Wooing in 1548 the English commander Edward Clinton planned to reconstruct the harbour and pier and their defences, employing a military engineer. The harbour at this time was dry at low-tide and ships lay in the ooze or mud. In 1622 a leaking Spanish ship entered the harbour and promptly sank. The crew said they were whalers, and they had whaling equipment, but the town baillies were suspicious and imprisoned the officers in the tolbooth and put the rest under house arrest under suspicion of piracy. The lawyer Thomas Hamilton arranged their release, arguing they had committed no crime and there was peace with Spain at the time. In 1633 a barge, the Blessing of Burntisland, carrying Charles I and his entourage's baggage from Burntisland to Leith sank with the loss of Charles' treasure.