Shouldn't this be `$this->filename_extension = $ext;`?