Added semi handling to low memory situations and removed redundant usings.