Fixed swmod malfunction in environments like "screen"