Merge contributions of mrqwer88 for Linux support.