Fix problem with swap creation