Added initial swift files and updated some bugs in legacy files.