Added proper stat() support