Fixed more bugs related to the re-structuring